<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!doctype html>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>任务列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<jsp:include page="/WEB-INF/views/common.jsp"></jsp:include>
  </head>
  
  <body class="easyui-layout">
	<div data-options="region:'center'">
		<input type="hidden" id="projectIndexId" value="${projectIndexId }">
		<!-- DataGrid -->
	    <table id="dg"></table>
	</div>
  </body>
<script type="text/javascript">
$(function(){
	var width = $(window).width();
	var w = width;
	$('#dg').datagrid({    
	    title: "任务列表",
		border:0,
		nowrap:true,
		striped:true,
		fit: true,//自动大小
		url:'task/queryList.shtml',
		queryParams : {projectIndexId : $('#projectIndexId').val()},
		frozenColumns : [[
			{field : 'id', title : 'id', hidden:true},    
	        {field : 'remark', title : '任务内容', width:0.4*w}
		]],
	    columns:[[    
	        {field : 'startTime', title : '任务计划时间段', width:0.25*w, align : 'center',
	        	formatter : function (value, row, index) {
	        		return formatTaskTimeAdv(value, row);
	        	}
	        },
	        {field : 'planAmount', title : '预算金额', width:0.15*w, align : 'center',
	        	formatter : function (value, row, index) {
	        		return formateAmount(value, row);
	        	}
	        },
	        {field : 'status', title : '审批状态', width:0.2*w, align : 'center',
	        	formatter : function (value, row, index) {
	        		return formateTaskStatusAdv(value, row);
	        	}
	        },
	        {field : 'createUserName', title : '创建人', width:0.15*w, align : 'center'},
	        {field : 'createTime', title : '创建时间', width:0.25*w, align : 'center'},
	        {field : 'factAmount', title : '实际使用资金', width:0.15*w, align : 'center',
	        	formatter : function (value, row, index) {
	        		return formateAmount(value, row);
	        	}
	        },
	        {field : 'progress', title : '总体进度', width:0.15*w, align : 'center',
	        	formatter : function (value, row, index) {
	        		return formateProgress(value, row);
	        	}
	        },
	        {field : 'taskActorNames', title : '相关参与人', width:0.3*w, align : 'center',
	        	formatter : function (value, row, index) {
	        		return displayTaskActor(value);
	        	}
	        }
	    ]],
		singleSelect:true,
		rownumbers:true,
		toolbar:'#tb',
		pagination:true,
		pageSize:50,
		onClickRow:function(rowIndex, rowData){}
	}).datagrid('getPager').pagination({  
        pageSize: 50,//每页显示的记录条数，默认为10  
        pageList: [50, 100, 200, 500],//可以设置每页记录条数的列表  
        beforePageText: '第',//页数文本框前显示的汉字  
        afterPageText: '页    共 {pages} 页',  
        displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'
    });
});
</script>  
</html>
